﻿namespace Stickam_Client
{
    [DesignerGenerated]
    public __gc class Form_ProxySettings : public Form
    {
        // Methods
        [DebuggerNonUserCode]
        public: Form_ProxySettings()
        {
            base->Load += new EventHandler __gc*(this.Form3_Load);
            this->InitializeComponent();
        }

        [DebuggerNonUserCode]
        protected: override void __gc* Dispose(Boolean __gc* disposing)
        {
            try
            {
                if (disposing && (this->components != 0))
                {
                    this->components->Dispose();
                }
            }
            finally
            {
                base->Dispose(disposing);
            }
        }

        private: void __gc* DoApply_Click(Object __gc* sender, EventArgs __gc* e)
        {
            this->SaveAndClose(true, false);
        }

        private: void __gc* DoClear_Click(Object __gc* sender, EventArgs __gc* e)
        {
            this->HttpEnabled->Checked = false;
            this->HttpIP->Text = S"";
            this->SocksHTTP->Checked = false;
            this->SocksIP->Text = S"";
            this->SocksRTMP->Checked = false;
            this->SocksVersion->SelectedIndex = 0;
        }

        private: void __gc* DoDone_Click(Object __gc* sender, EventArgs __gc* e)
        {
            this->SaveAndClose(true, true);
        }

        private: void __gc* Form3_Load(Object __gc* sender, EventArgs __gc* e)
        {
            Int32 __gc* num = 0;
            if (MySettingsProperty::Settings->SocksVersion == 5)
            {
                num = 1;
            }
            this->HttpEnabled->Checked = MySettingsProperty::Settings->HttpEnabled;
            this->HttpIP->Text = MySettingsProperty::Settings->HttpIP;
            this->SocksHTTP->Checked = MySettingsProperty::Settings->SocksHTTP;
            this->SocksIP->Text = MySettingsProperty::Settings->SocksIP;
            this->SocksRTMP->Checked = MySettingsProperty::Settings->SocksRTMP;
            this->SocksVersion->SelectedIndex = num;
        }

        [DebuggerStepThrough]
        private: void __gc* InitializeComponent()
        {
            ComponentResourceManager __gc* manager = __gc new ComponentResourceManager(__typeof(Form_ProxySettings));
            this->Label1 = __gc new Label();
            this->SocksVersion = __gc new ComboBox();
            this->SocksRTMP = __gc new CheckBox();
            this->SocksHTTP = __gc new CheckBox();
            this->DoDone = __gc new Button();
            this->GroupBox1 = __gc new GroupBox();
            this->HttpEnabled = __gc new CheckBox();
            this->HttpIP = __gc new TextBox();
            this->Label2 = __gc new Label();
            this->GroupBox2 = __gc new GroupBox();
            this->SocksIP = __gc new TextBox();
            this->DoApply = __gc new Button();
            this->DoClear = __gc new Button();
            this->GroupBox1->SuspendLayout();
            this->GroupBox2->SuspendLayout();
            this->SuspendLayout();
            this->Label1->AutoSize = true;
            Point __gc* point = (1, 15);
            this->Label1->Location = point;
            this->Label1->Name = S"Label1";
            Size __gc* size = (0x11, 12);
            this->Label1->Size = size;
            this->Label1->TabIndex = 0;
            this->Label1->Text = S"IP:";
            this->SocksVersion->DropDownStyle = ComboBoxStyle::DropDownList;
            this->SocksVersion->FormattingEnabled = true;
            this->SocksVersion->Items->AddRange(__gc new Object __gc*[2] {
                S"4", S"5"});
            point = (0x73, 13);
            this->SocksVersion->Location = point;
            this->SocksVersion->Name = S"SocksVersion";
            size = (0x23, 20);
            this->SocksVersion->Size = size;
            this->SocksVersion->TabIndex = 2;
            this->SocksRTMP->AutoSize = true;
            point = (0x3e, 0x21);
            this->SocksRTMP->Location = point;
            this->SocksRTMP->Name = S"SocksRTMP";
            size = (0x33, 0x10);
            this->SocksRTMP->Size = size;
            this->SocksRTMP->TabIndex = 3;
            this->SocksRTMP->Text = S"RTMP";
            this->SocksRTMP->UseVisualStyleBackColor = true;
            this->SocksHTTP->AutoSize = true;
            point = (0x10, 0x21);
            this->SocksHTTP->Location = point;
            this->SocksHTTP->Name = S"SocksHTTP";
            size = (0x2f, 0x10);
            this->SocksHTTP->Size = size;
            this->SocksHTTP->TabIndex = 4;
            this->SocksHTTP->Text = S"HTTP";
            this->SocksHTTP->UseVisualStyleBackColor = true;
            this->DoDone->FlatStyle = FlatStyle::Popup;
            this->DoDone->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x68, 0x57);
            this->DoDone->Location = point;
            this->DoDone->Name = S"DoDone";
            size = (50, 0x12);
            this->DoDone->Size = size;
            this->DoDone->TabIndex = 5;
            this->DoDone->Text = S"DONE";
            this->DoDone->UseCompatibleTextRendering = true;
            this->DoDone->UseVisualStyleBackColor = true;
            this->GroupBox1->Controls->Add(this->HttpEnabled);
            this->GroupBox1->Controls->Add(this->HttpIP);
            this->GroupBox1->Controls->Add(this->Label2);
            this->GroupBox1->Enabled = false;
            this->GroupBox1->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (1, 0);
            this->GroupBox1->Location = point;
            this->GroupBox1->Name = S"GroupBox1";
            size = (0x99, 0x23);
            this->GroupBox1->Size = size;
            this->GroupBox1->TabIndex = 6;
            this->GroupBox1->TabStop = false;
            this->GroupBox1->Text = S"HTTP";
            this->HttpEnabled->AutoSize = true;
            point = (0x89, 15);
            this->HttpEnabled->Location = point;
            this->HttpEnabled->Name = S"HttpEnabled";
            size = (15, 14);
            this->HttpEnabled->Size = size;
            this->HttpEnabled->TabIndex = 2;
            this->HttpEnabled->UseVisualStyleBackColor = true;
            this->HttpIP->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x10, 13);
            this->HttpIP->Location = point;
            this->HttpIP->Name = S"HttpIP";
            size = (0x76, 0x12);
            this->HttpIP->Size = size;
            this->HttpIP->TabIndex = 1;
            this->Label2->AutoSize = true;
            point = (1, 15);
            this->Label2->Location = point;
            this->Label2->Name = S"Label2";
            size = (0x11, 12);
            this->Label2->Size = size;
            this->Label2->TabIndex = 0;
            this->Label2->Text = S"IP:";
            this->GroupBox2->Controls->Add(this->SocksIP);
            this->GroupBox2->Controls->Add(this->Label1);
            this->GroupBox2->Controls->Add(this->SocksVersion);
            this->GroupBox2->Controls->Add(this->SocksRTMP);
            this->GroupBox2->Controls->Add(this->SocksHTTP);
            this->GroupBox2->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (1, 0x23);
            this->GroupBox2->Location = point;
            this->GroupBox2->Name = S"GroupBox2";
            size = (0x99, 0x33);
            this->GroupBox2->Size = size;
            this->GroupBox2->TabIndex = 7;
            this->GroupBox2->TabStop = false;
            this->GroupBox2->Text = S"SOCKS";
            point = (0x10, 13);
            this->SocksIP->Location = point;
            this->SocksIP->Name = S"SocksIP";
            size = (0x62, 0x12);
            this->SocksIP->Size = size;
            this->SocksIP->TabIndex = 1;
            this->DoApply->FlatStyle = FlatStyle::Popup;
            this->DoApply->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x34, 0x57);
            this->DoApply->Location = point;
            this->DoApply->Name = S"DoApply";
            size = (0x33, 0x12);
            this->DoApply->Size = size;
            this->DoApply->TabIndex = 8;
            this->DoApply->Text = S"APPLY";
            this->DoApply->UseCompatibleTextRendering = true;
            this->DoApply->UseVisualStyleBackColor = true;
            this->DoClear->FlatStyle = FlatStyle::Popup;
            this->DoClear->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (1, 0x57);
            this->DoClear->Location = point;
            this->DoClear->Name = S"DoClear";
            size = (50, 0x12);
            this->DoClear->Size = size;
            this->DoClear->TabIndex = 9;
            this->DoClear->Text = S"CLEAR";
            this->DoClear->UseCompatibleTextRendering = true;
            this->DoClear->UseVisualStyleBackColor = true;
            SizeF __gc* ef = (6, 13);
            this->AutoScaleDimensions = ef;
            this->AutoScaleMode = AutoScaleMode::Font;
            size = (0x9b, 0x6a);
            this->ClientSize = size;
            this->Controls->Add(this->DoClear);
            this->Controls->Add(this->DoApply);
            this->Controls->Add(this->GroupBox2);
            this->Controls->Add(this->GroupBox1);
            this->Controls->Add(this->DoDone);
            this->FormBorderStyle = FormBorderStyle::FixedToolWindow;
            this->Icon = *static_cast<__box Icon*>(manager->GetObject(S"$this.Icon"));
            this->MaximizeBox = false;
            this->Name = S"Form_ProxySettings";
            this->StartPosition = FormStartPosition::Manual;
            this->Text = S"Proxy Settings";
            this->GroupBox1->ResumeLayout(false);
            this->GroupBox1->PerformLayout();
            this->GroupBox2->ResumeLayout(false);
            this->GroupBox2->PerformLayout();
            this->ResumeLayout(false);
        }

        private: void __gc* SaveAndClose(Boolean __gc* DoSave, Boolean __gc* DoClose)
        {
            if (DoSave)
            {
                this->HttpIP->Text = Strings::Trim(this->HttpIP->Text);
                this->SocksIP->Text = Strings::Trim(this->SocksIP->Text);
                if (this->HttpEnabled->Checked && !Globals::IsValidIP(this->HttpIP->Text))
                {
                    Interaction::MsgBox(S"One or more IP addresses you have entered are invalid, please correct them.", MsgBoxStyle::OkOnly, S"Proxy Settings");
                    return;
                }
                if ((this->SocksHTTP->Checked | this->SocksRTMP->Checked) && !Globals::IsValidIP(this->SocksIP->Text))
                {
                    Interaction::MsgBox(S"One or more IP addresses you have entered are invalid, please correct them.", MsgBoxStyle::OkOnly, S"Proxy Settings");
                    return;
                }
                Int32 __gc* num = 4;
                if (this->SocksVersion->SelectedIndex == 1)
                {
                    num = 5;
                }
                MySettingsProperty::Settings->HttpEnabled = this->HttpEnabled->Checked;
                MySettingsProperty::Settings->HttpIP = this->HttpIP->Text;
                MySettingsProperty::Settings->SocksHTTP = this->SocksHTTP->Checked;
                MySettingsProperty::Settings->SocksIP = this->SocksIP->Text;
                MySettingsProperty::Settings->SocksRTMP = this->SocksRTMP->Checked;
                MySettingsProperty::Settings->SocksVersion = num;
            }
            if (DoClose)
            {
                this->Close();
            }
        }


        // Properties
        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_DoApply()
        {
            return this->_DoApply;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_DoApply(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.DoApply_Click);
            if (this->_DoApply != 0)
            {
                this->_DoApply->Click -= handler;
            }
            this->_DoApply = WithEventsValue;
            if (this->_DoApply != 0)
            {
                this->_DoApply->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_DoClear()
        {
            return this->_DoClear;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_DoClear(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.DoClear_Click);
            if (this->_DoClear != 0)
            {
                this->_DoClear->Click -= handler;
            }
            this->_DoClear = WithEventsValue;
            if (this->_DoClear != 0)
            {
                this->_DoClear->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_DoDone()
        {
            return this->_DoDone;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_DoDone(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.DoDone_Click);
            if (this->_DoDone != 0)
            {
                this->_DoDone->Click -= handler;
            }
            this->_DoDone = WithEventsValue;
            if (this->_DoDone != 0)
            {
                this->_DoDone->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual GroupBox __gc* get_GroupBox1()
        {
            return this->_GroupBox1;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_GroupBox1(GroupBox __gc* WithEventsValue)
        {
            this->_GroupBox1 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual GroupBox __gc* get_GroupBox2()
        {
            return this->_GroupBox2;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_GroupBox2(GroupBox __gc* WithEventsValue)
        {
            this->_GroupBox2 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual CheckBox __gc* get_HttpEnabled()
        {
            return this->_HttpEnabled;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_HttpEnabled(CheckBox __gc* WithEventsValue)
        {
            this->_HttpEnabled = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual TextBox __gc* get_HttpIP()
        {
            return this->_HttpIP;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_HttpIP(TextBox __gc* WithEventsValue)
        {
            this->_HttpIP = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Label __gc* get_Label1()
        {
            return this->_Label1;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_Label1(Label __gc* WithEventsValue)
        {
            this->_Label1 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Label __gc* get_Label2()
        {
            return this->_Label2;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_Label2(Label __gc* WithEventsValue)
        {
            this->_Label2 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual CheckBox __gc* get_SocksHTTP()
        {
            return this->_SocksHTTP;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_SocksHTTP(CheckBox __gc* WithEventsValue)
        {
            this->_SocksHTTP = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual TextBox __gc* get_SocksIP()
        {
            return this->_SocksIP;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_SocksIP(TextBox __gc* WithEventsValue)
        {
            this->_SocksIP = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual CheckBox __gc* get_SocksRTMP()
        {
            return this->_SocksRTMP;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_SocksRTMP(CheckBox __gc* WithEventsValue)
        {
            this->_SocksRTMP = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual ComboBox __gc* get_SocksVersion()
        {
            return this->_SocksVersion;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_SocksVersion(ComboBox __gc* WithEventsValue)
        {
            this->_SocksVersion = WithEventsValue;
        }


        // Fields
        [AccessedThroughProperty(S"DoApply")]
        private: Button __gc* _DoApply;
        [AccessedThroughProperty(S"DoClear")]
        private: Button __gc* _DoClear;
        [AccessedThroughProperty(S"DoDone")]
        private: Button __gc* _DoDone;
        [AccessedThroughProperty(S"GroupBox1")]
        private: GroupBox __gc* _GroupBox1;
        [AccessedThroughProperty(S"GroupBox2")]
        private: GroupBox __gc* _GroupBox2;
        [AccessedThroughProperty(S"HttpEnabled")]
        private: CheckBox __gc* _HttpEnabled;
        [AccessedThroughProperty(S"HttpIP")]
        private: TextBox __gc* _HttpIP;
        [AccessedThroughProperty(S"Label1")]
        private: Label __gc* _Label1;
        [AccessedThroughProperty(S"Label2")]
        private: Label __gc* _Label2;
        [AccessedThroughProperty(S"SocksHTTP")]
        private: CheckBox __gc* _SocksHTTP;
        [AccessedThroughProperty(S"SocksIP")]
        private: TextBox __gc* _SocksIP;
        [AccessedThroughProperty(S"SocksRTMP")]
        private: CheckBox __gc* _SocksRTMP;
        [AccessedThroughProperty(S"SocksVersion")]
        private: ComboBox __gc* _SocksVersion;
        private: IContainer __gc* components;
    };
}

